1. Field of the Invention
The present invention relates to an image processing apparatus having a secondary battery, a method of controlling the image processing apparatus, and a program.
2. Description of the Related Art
In multi-functional peripherals (MFPs) having a print function, a scanning function, and a facsimile function, and printers, history information is managed in association with a job to be executed and managed. Specifically, even if a power failure occurs in the middle of the execution of printing, scanning, or facsimile processing (hereinafter, referred to as job processing) and the job is interrupted, it is required to correctly maintain history information such as a page counter, and to continue the job processing (recovery processing) after recovery from the power failure. To achieve this, as a first method, progress information of the job processing is sequentially written in a nonvolatile memory during the job processing.
As a second method, a rechargeable secondary battery is mounted on the apparatus, and when a power failure is detected, electric power is supplied from the secondary battery, and the progress information of the job processing is stored in a nonvolatile memory such as a hard disk drive (HDD) or a flash memory. For example, in a case of a print job, the number of pages printed in the job being processed is stored in a nonvolatile memory when a power failure occurred, and for the recovery processing subsequent to return from the power failure, the number of data-processed pages is stored.
In the above-described image processing apparatus, for example, in the case of the print job, each time the printing of one page is completed, the billing information is stored in the nonvolatile memory, and for the recovery subsequent to the return from the power failure, when data processing for each page is completed, the number of the processed page is stored as job progress information. In the job processing, the information is appropriately stored in the nonvolatile memory, and consequently, even if a power failure occurs at any time, no problems occur. In the first method, however, the writing speed to the nonvolatile memory is lower than the writing speed to a volatile memory, and the recovery information is sequentially written in the middle of the job processing. Consequently, the time necessary for the writing processing decreases the processing speed.
Especially, when a NAND type flash memory is used as the nonvolatile memory, it is hard to effectively perform the sequential writing processing of data of small amounts in different addresses. In the MFP, jobs of different job types can be processed in parallel. Consequently, it is also necessary to consider writing the job progress information to different addresses for the individual job types.
In the second method, when the amount of electric power stored in the secondary battery is smaller than the amount of electric power to be consumed in the storage processing of the progress information at the time of the occurrence of the power failure, it is not possible to use the memory.
To make up for the problems in these two methods, in a known technique, when the amount of the electricity stored in the secondary battery is insufficient to store the progress information in the nonvolatile memory, the first method is employed, and when the stored electricity amount of the secondary battery is sufficient, the second method is employed.For example, the technique is applied to a method of using a cache memory in an HDD (Japanese Patent Application Laid-Open No. 2006-313407). In this method, depending on a stored electricity amount, the cache memory is switched between a write-back mode in which the processing speed is high and synchronization is necessary at the time of occurrence of a power failure, and a write-through mode in which the processing speed is low and synchronization is not necessary at the time of occurrence of a power failure. In the job processing in the MFP, however, providing such a dedicated hardware discussed in the known technique for the sequential storage of the progress information of the job increases the costs.